package api;

import com.oraro.common.result.Result;
import dto.PayOrderParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @Author: jianghuiyong
 * @Date: 2018/12/11 9:45
 * @Version 1.0
 */
@FeignClient(name = "pay-gateway", fallback =payOrderFallback.class, path = "/pay")
public interface payOrder {

    /**
     * 创建支付订单
     * @param payOrderParam
     * @return
     */
    @PostMapping("/createOrder")
    Result createOrder (@RequestBody PayOrderParam payOrderParam);

    /**
     * 检查支付订单
     * @param orderId
     * @return
     */
    @GetMapping("/checkOrder")
    Result checkOrder(Long orderId);

    /**
     * 执行支付订单
     * @param orderId
     * @param payType
     * @return
     */
    @PostMapping("/payOrder")
    Result payOrder (Long orderId, String payType);


}
